<?php
error_reporting(0);
require_once 'function.php';
$num_iid = $_GET['num_iid'];
if(empty($num_iid))
{
	$iid = $_GET['iid'];
	if(!empty($iid))
	{
		$Taoapi->method = 'taobao.item.get';
		$Taoapi->fields = 'iid,num_iid';
		$Taoapi->iid = $iid;
		$TaoapiItem = $Taoapi->Send('get','xml')->getArrayData();
		$num_iid = $TaoapiItem["item"]["num_iid"];
	}
}

$Taoapi->method = 'taobao.taobaoke.items.detail.get';
$Taoapi->fields = 'title,click_url';
$Taoapi->nick = $usernick;
$Taoapi->num_iids = $num_iid;
$TaoapiItem = $Taoapi->Send('get','xml')->getArrayData();
$result_item = $TaoapiItem["taobaoke_item_details"]["taobaoke_item_detail"];
$click_url = $result_item["click_url"];
if(!$click_url){
	$click_url="http://www.tmall.com/go/chn/tbk_channel/tmall_new.php?pid=".$userpid."&eventid=101334";
}
else
{
	//$click_url=str_replace('mm_17538449_0_0','mm_12573392_0_0',$click_url);
}
?>
<html><head><meta http-equiv="refresh" content="0; url=<?php echo $click_url; ?>"></head></html>